package org.wk.news.enums;

/**
 * @ClassName NewsStatus
 * @Description 资讯状态状态
 * @Author ZhaoPing'an
 * @Date 2018/7/13 10:59
 */
public enum  NewsStatus {
    HAS_PUBLISH("1","已发布"),
    NOT_PUBLISH("0","未发布");
    private String code;
    private String name;

    public static NewsStatus containsCode(String code) {
        for (NewsStatus item : NewsStatus.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }

    NewsStatus(String code, String name) {

        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }
}
